package com.mscsoft.brainpower.server.action;

import javax.annotation.Resource;
import com.mscsoft.brainpower.server.domain.*;
import com.mscsoft.brainpower.server.service.GameService;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GameAction {
    @Resource
    GameService gameService;

    @RequestMapping("/game/getBestScore")
    public Msg<GameScore> getBestScore(int uid, int msid) {
        return gameService.getBestScore(uid, msid);
    }

    @RequestMapping("/game/updateScore")
    public Msg<Object> updateScore(int uid, int msid, int score, int combo, boolean ap, boolean fc) {
        return gameService.updateScore(uid, msid, score, combo, ap, fc);
    }

    @RequestMapping("/game/getScoreRank")
    public Msg<ScoreRank[]> getScoreRank(int msid) {
        return gameService.getScoreRank(msid);
    }
}
